package net.jgrm.common.exception;

/**
 * 系统异常枚举
 *
 * @author service-common
 * @date 2024-09-12
 */
public enum SystemExceptionEnum implements BaseExceptionEnum {

    SYSTEM_ERROR(10001, "服务器繁忙，请稍后再试"),
    SERVICE_UNAVAILABLE(10002, "服务暂停，请稍后再试"),
    REMOTE_SERVICE_ERROR(10003, "远程服务错误"),
    IP_LIMIT(10004, "IP限制不能请求该资源"),
    UNSUPPORT_MEDIATYPE(10005, "不支持的MediaType (%s)"),
    PARAM_ERROR(10006, "参数错误"),
    ILLEGAL_REQUEST(10007, "非法请求"),
    INVALID_USER(10008, "不合法的用户"),
    MISS_REQUIRED_PARAMETER(10009, "缺失必选参数 (%s)"),
    PARAMETER_VALUE_INVALID(10010, "参数值非法 (%s:%s)"),
    REQUEST_BODY_LENGTH_OVER_LIMIT(10011, "请求长度超过限制"),
    REQUEST_API_NOT_FOUND(10012, "接口不存在"),
    UNSUPPORT_HTTP_METHOD(10013, "请求的HTTP METHOD不支持");

    private final Integer code;
    private final String message;

    SystemExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}